package com.hh.front.controller;

import com.hh.common.response.CommonResult;
import com.hh.common.response.im.UserSigResponse;
import com.hh.service.service.im.ImUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * IM
 */
@Slf4j
@RestController()
@RequestMapping("api/front/im")
public class ImController {

    @Autowired
    private ImUserService imService;

    /**
     * 生成UserSig
     * @return
     */
    @RequestMapping(value = "/generateUserSig", method = RequestMethod.GET)
    public CommonResult<UserSigResponse> generateUserSig(){
        UserSigResponse userSigResponse = imService.generateUserSig();
        return CommonResult.success(userSigResponse);
    }

//    /**
//     * 注册im用户（测试）
//     * @return
//     */
//    @RequestMapping(value = "/registerImUser", method = RequestMethod.GET)
//    public CommonResult<Boolean> registerImUser(){
//        return CommonResult.success(imService.registerImUser());
//    }

    /**
     * 注册im用户（测试）
     * @return
     */
    @RequestMapping(value = "/registerImUser", method = RequestMethod.GET)
    public CommonResult<Boolean> registerImUser(){
        return CommonResult.success(imService.registerImUser());
    }
}
